package top.lixunda.ecommerce.server.auth.api.entity.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import top.lixunda.common.validate.annotation.XumBetween;
import top.lixunda.common.validate.annotation.XumNotNull;
import top.lixunda.common.validate.annotation.XumPhone;

/**
 * 短信验证码信息DTO
 *
 * @author Xumda
 * @version time:2019/12/17 15:14
 */
@ApiModel("短信验证码信息DTO")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class PhoneCodeDTO {

    /**
     * 发送的账号
     */
    @ApiModelProperty(value = "发送的账号", notes = "不能为空，手机号码格式要求")
    @XumNotNull
    @XumPhone
    private String phone;

    /**
     * 发送的验证码
     */
    @ApiModelProperty(value = "发送的验证码", notes = "不能为空，长度为4到6位")
    @XumNotNull
    @XumBetween(min = 4, max = 6)
    private String code;

}
